rust(feat): gate MCP tools with account feature flags at startup - #764
Merged
Conversation
evan-sift
marked this pull request as ready for review
August 27, 2026 23:31
lineville
previously approved these changes
Aug 28, 2026
lineville
left a comment
Contributor
There was a problem hiding this comment.
Looks good, I think this might warrant a changelog entry as well but other than that lgtm!
lineville
approved these changes
Aug 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The MCP server now resolves the account's enabled feature flags at startup, using the configured API key, and excludes tools whose flag is not enabled. Most tools carry no flag and are always registered.
sift_mcp::FeatureFlags: fetched once at startup viaGET /api/v1/feature-flags/variants(5s timeout, bearer auth). A flag is enabled when its variant value is non-empty and notoff.feature_flags.rsmaps tool names to required flags; gated tools are removed from the router before serving, so they are absent fromtools/listand rejected on call.--disable-nonessential-traffic(help text updated).Verification
cargo test -p sift_mcp: 311 passed. New coverage: wire-level fetch test (request line, bearer header, trailing-slash URI, 500 handling, response parse), registry drift guard, client-event invariant with all flags enabled, wire-leveltools/listandtools/callfor both flag states, fail-closed default behavior, enabled-semantics unit tests.cargo check -p sift_cli,cargo fmt --all --check,cargo clippy --all-features(no new warnings) all pass.with ff off:
with ff on: